#
# Functions for standard (RFC 1491-1494) bounce messages
# that are broken according to spec.
#
# Implements interface of Bounce::Mail
#

package Mail::Bounce::Standard::Buggy;

use strict;

use Mail::Bounce::Address;

use vars qw(@ISA $DEBUG);

use Carp;

@ISA = qw(Mail::Bounce::Standard);

$DEBUG = 0;

sub isbounce {
    # if it is dispatched here, it is a bounce
    return 1;
}

sub recipients {
    my $self = shift;
    
    my $savestrict = $Mail::Bounce::Address::strict;
    $Mail::Bounce::Address::strict = 0;
    my $recipcount;
    my @recips;

    eval {
	if (wantarray) {
	    @recips = Mail::Bounce::Standard::recipients($self);
	} else {
	    $recipcount = Mail::Bounce::Standard::recipients($self);
	}
    };
    if ($@) {
	carp "Standard::Buggy: still dies under nostrict";
	carp "Error is $@";
	$recipcount = 0;
    }
    $Mail::Bounce::Address::strict = $savestrict;
    if (wantarray) {
	return @recips;
    } else {
	return $recipcount;
    }
}

1;
